The present invention relates generally to synchronization of data, and specifically to the synchronization of an MPEG-2 system time clock to a program clock reference.
Decompression of MPEG-2 data requires synchronization between audio and visual component data. The precise time when uncompressed data is to be presented is generally indeterminate relative to the time when the data is received in compressed form. However, through the use of presentation time stamps (PTS) it is possible to positively identify specific presentation times for audio, visual or auxiliary data. Program clock reference time stamps that are giving a xe2x80x98stream timexe2x80x99 are transmitted in the adaptation field of audio or visual packets or auxiliary data (depending which stream is a master) at least ten times every second. Having a stream time and xe2x80x9cstampingxe2x80x9d the data associated with the packet containing the PTS time stamp (presentation time stamp), a reference time is established at which the data is to be given to the audio/video/aux decoder. PTS is available at the PES header, usually with the start of video or audio frame in the same PES packet payload.
The decoder system reference time to which the PTS time is qualified is referred to as the System Time Clock (STC). The STC is a counter, or clock reference, maintained by the receiving (decoder) system. By comparing the values of the PTS time stamps to the system time clock and rendering the data associated with the PTS time stamps when a match occurs, synchronized presentation of audio and visual data is obtained. Note that the STC includes a nine-bit extension portion, which acts as a prescaler for clocking a 33-bit base portion. The PTS has only a 33-bit portion. Comparison of the PTS time stamp is made to the STC""s 33-bit base portion.
The use of PTS values are meaningful only if the STC is initialized, synchronized, and accurate with respect to an absolute time of a system encoder. The absolute time of the system encoder is periodically provided to the decoding system as a Program Clock Reference (PCR) transmitted as part of the adaptation field of a packet. Initializing and locking to received PCR values can maintain an absolute time reference to the encoder system by the decoder system.
The time base of the STC and the encoder system is appropriately 27 MHz. To prevent overflow or underflow of received compressed bit stream buffers, the STC counter associated with the MPEG-2 decoder has to be synchronized to the 27 MHz time base of the system encoder with an accuracy of 1 Hertz. For example, if the STC counter associated with decoder is running slower than the time base reference (PCR) of the encoder, buffers which store compressed data for use by the decompression engine will overflow. Likewise, if the STC counter is running faster than the time base reference of the encoder, buffers which store compressed data for use by the decompression engine will underflow. Either an overflow or an underflow condition will cause an anomaly to occur in the display of the data.
The MPEG-2 standard requires a maximum deviation of +/xe2x88x9250 ppm for the encoder system clock, and a maximum deviation of +xe2x88x9225 ppm for a crystal oscillator associated with the decoder clock, giving a worst-case deviation of timing between the transmitter and receiver of +xe2x88x9275 ppm. However, such a worst case deviation of 4 Mbps standard definition video allows an overflow or underflow condition to occur every 7.1 minutes. Such an error rate is considered unacceptable for many audio video applications.
Therefore, it would be advantageous to have a system clock recovery system and/or method capable of maintaining stable MPEG-2 decoding for long periods of time for applications where increased integrity of presented data is desirable.